/*!
 * \file GraphInput.h
 *
 * \date Nov 24, 2012
 * \author correa
 */

#ifndef GRAPHINPUT_H_
#define GRAPHINPUT_H_

#include <Graph.h>

namespace std {

class GraphInput {
public:
	GraphInput();
	virtual ~GraphInput();

	/*!
	 * \brief Reads a graph from a file.
	 *
	 * The file must be in the DIMACS benchmark format, which means that it
	 * must start with a line \c p \c x \c y indicating the number of vertices \c x
	 * and the number of edges \c y. Each edge must be in a line
	 * starting with character \c e followed by the first endpoint of the edge plus
	 * space plus the second endpoint.
	 *
	 * The file must have no blank lines and each edge must be in a single line. If the
	 * file is not in the DIMACS format an error will occur.
	 *
	 * \param graphFile the file in a specified form to represent a graph
	 * \param t indicates if we read the graph or its complement
	 * \param factory an abstract factory used to instantiate the graph object
	 * \param handle additional parameters to be passed to the factory when the graph is instantiated
	 *
	 * \return the resulting graph
	 */
	template <class T>
	static T * readDimacsGraph(FILE * graphFile, graphType t, Factory<T> * factory, void * handle);
};

} /* namespace std */
#endif /* GRAPHINPUT_H_ */
